home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DlpiEnet.h
-
- Contains: Ethernet DLPI module
-
- Version: 1.0.0
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef __DLPIENET_H__
- #define __DLPIENET_H__
-
- typedef struct Dlpi Dlpi;
- typedef Dlpi *DlpiPtr;
-
- // DlpiStreamWput() is the STREAMS Write-side put routine.
- // Downstream messages are processed here.
- // Returns zero.
- extern int DlpiStreamWput(queue_t *, mblk_t *);
-
- // DlpiStreamWsrv() is the STREAMS Write-side service routine.
- // Messages in the write queue are processed here.
- // Returns zero.
- extern int DlpiStreamWsrv(queue_t *);
-
- // DlpiStreamRsrv() is the STREAMS Read-side put routine.
- // This is not implemented.
- #define DlpiStreamRput NULL
-
- // DlpiStreamRsrv() is the STREAMS Read-side service routine.
- // Messages in the read queue are processed here.
- // Returns zero.
- extern int DlpiStreamRsrv(queue_t *);
-
- // DlpiStreamClose() is the STREAMS close routine.
- extern int DlpiStreamClose(queue_t *, int flag, cred_t *);
-
- // DlpiStreamOpen() is the STREAMS open routine.
- extern int
- DlpiStreamOpen(DlpiPtr, queue_t *, dev_t *, int flag, int sflag, cred_t *);
-
- // DlpiPower() turns the associated hardware on or off.
- // Returns false if there was an error.
- extern Boolean DlpiPower(DlpiPtr, Boolean on);
-
- // DlpiClose() terminates access to the Dlpi module.
- // It invalidates the DlpiPtr and returns NULL.
- // Returns the DlpiPtr if there was an error.
- // WARNING: If there was an error, then the driver is *NOT* closed!
- // This will happen if any buffers were not returned to the pool.
- extern DlpiPtr DlpiClose(DlpiPtr);
-
- // DlpiOpen() prepares the enet module for operation.
- // Full kernel services must be available.
- // The Enet module will be opened.
- // Returns a pointer to the allocated Dlpi structure.
- // Returns NULL if there was an error.
- // The txMaxBuffer is the number of buffers in the transmit pool.
- // The txMinUnblock is the maximum number of buffers sent before unblocking.
- // The txMaxService is the maximum number of buffers that trigger service.
- // The rxMaxBuffer is the number of buffers in the receive pool.
- // The rxMinService1 is minimum number of buffers that trigger service.
- // The rxMinService2 is minimum number of buffers that trigger service.
- // The rxMinPass is the minimum number of buffers that allow pass.
- // The rxMaxCopy the maximum number of bytes that force copy.
- extern DlpiPtr
- DlpiOpen(void *enetCookie,
- char *driverName,
- Count txMaxBuffer,
- Count txMaxService,
- Count txMinUnblock,
- Count rxMaxBuffer,
- Count rxMinService1,
- Count rxMinService2,
- Count rxMinPass,
- Count rxMaxCopy);
-
- // DlpiProbe() tests for the existance of Enet hardware.
- // Returns false if there is no hardware.
- extern Boolean DlpiProbe(void *enetCookie, char *driverName);
-
- #endif // __DLPIENET_H__
-